
<form id="form" action="{:url('store.card/edit')}">
<input type="hidden" name="id" value="{$info.id}"/>
<table class="formtable"> 
    {if empty($info)}
    <tr>
        <th>所属好店:</th>
        <td>
            <input datatype="n" readonly="readonly" id="store_id" class="readonly input" type="text" name="store_id" value="{$info.store_id}" />
            <button url="{:url('store.index/selectStore')}" data="store_id" type="button" class="selectid button"><i class="iconfont icon-store_icon"></i>选择好店</button>
            <button url="{:url('store.index/review')}" type="button" class="reviewStore button button-blue"><i class="iconfont icon-search_icon"></i>预览</button>
        </td>
    </tr>
    {/if}
    <tr><th>活动名称:</th><td><input class="input" datatype="*" type="text" name="name" value="{$info.name}" /></td></tr>
    <tr><th>结束日期:</th><td><input readonly class="input ui-date" datatype="date" type="text" name="locktime" value="{$info.locktime?date('Y-m-d',$info.locktime):''}" /></td></tr>
    <tr><th>付款金额:</th><td><input class="input" datatype="npot" type="text" name="price" value="{$info.price}" /> <span class="gray">元</span></td></tr>
    <tr><th>储值额度:</th><td><input class="input" datatype="n" type="text" name="amount" value="{$info.coupon.amount}" /> <span class="gray">元</span></td></tr>
    <tr><th>使用门槛:</th><td><input class="input" datatype="npot" type="text" name="howmuch" value="{$info.coupon.howmuch}" /> <span class="gray">元</span></td></tr>
    <tr><th>储值数量:</th><td><input class="input" datatype="n" type="text" name="num" value="{$info.coupon.num}" /></td></tr>
    <tr><th>规则描述:</th><td><input class="input w300" datatype="*" type="text" name="tips" value="{$info.coupon.tips}" /></td></tr>
    <tr><th>使用须知:</th><td><div class="w600"><textarea class="input w300 ui-mieditor" datatype="*" type="text" name="content" />{$info.tips|dehtml}</textarea></div></td></tr>
    <tr><th></th><td><input type="submit" value="确定" class="button button-blue submit" /><input type="reset" value="重置" class="button button-blank"/></td></tr>
</table>
</form>
<script type="text/javascript">
Do('base','layer','form','editor','date', function () {
    $('#form').isForm({'upload':'{:url("system/passport.common/upload")}'});
    $(".selectid").win();
    $(".reviewStore").click(function(){
        var id = $("#store_id").val();
        if(id== null || id=="" || id=='undefined'){
           parent.layer.alert('没有选择所属好店')
        }else{
            $(this).popup({'url':'{:url("store.index/review")}?id='+id})
        }
    });
})
function setState(store){
    $('#store_id').val(store.id);
}
</script>